<style lang='scss'>

.el-breadcrumb {
    display: inline-block;
    font-size: 14px;

    .el-breadcrumb__item{

        .el-breadcrumb__inner.is-link{
            cursor:default;
            color:#fff;
        }
    }


    .el-breadcrumb__item.hlight{
        .el-breadcrumb__inner.is-link{
            color: #fff;
        }
    }

}
.breadcrumb-box {
    display: flex;
    font-size: 14px;
    margin-left: 10px;
    color: #fff;
}
</style>

<template>
    <div class="breadcrumb-box">
        <div class="el-breadcrumb">
            <span  style='cursor:default'>当前所在位置：{{$route.name}}</span>
        </div>
        <!-- <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item v-for="item  in breadList" :key="item.path">{{item.name}}
            </el-breadcrumb-item>
        </el-breadcrumb> -->
    </div>
</template>

<script>
//在页面使用需要导入vuex提供的这四个函数
import { mapGetters, mapActions, mapMutations, mapStates } from 'vuex';


export default {
    name:'bread',
    data() {
        return {
            routePath:'',
            breadList: [], // 路由集合
        }
    },
    components: {},
    computed: {
        ...mapGetters([]),
    },
    created() {
        this.getBreadcrumb()
    },
    watch: {
        $route() {
            this.getBreadcrumb()
        }
    },
    methods: {

        getBreadcrumb() {
            
            // let name=this.$route.name;
            // this.routePath=this.$route.path;
            // var breadNumber= this.$route.meta.breadNumber ? this.$route.meta.breadNumber : 1; //默认为1
            // if(this.routePath == '/rule/ruleLibView' && this.$route.query.ruleRepositoryName){
            //     name=name+'-'+this.$route.query.ruleRepositoryName;
            // }else if(this.routePath == '/rule/ruleList' && this.$route.query.ruleRepositoryName){
            //     name=this.$route.query.ruleRepositoryName+'-'+name;
            // }else if(this.routePath == '/decision/strategy/strategyInfo' && this.$route.query.strategyName){
            //     name=name+'-'+this.$route.query.strategyName;
            // }
            // else if(this.routePath == '/rule/ruleView' && this.$route.query.ruleName){
            //     name=name+'-'+this.$route.query.ruleName;
            // }

            // var newBread={name:name,path:this.$route.path,fullPath:this.$route.fullPath};//当前页面的

            // let breadListStorage=sessionStorage.getItem('breadListStorage');
            // var breadList= breadListStorage ? JSON.parse(breadListStorage) : [];//获取breadList数组

            // if(breadNumber == 1 && breadList.length > 0 && breadList[0].path != this.routePath){
            //     breadList=[];
            //     breadList.push(newBread);

            // }else{

            //     breadList.splice(breadNumber-1,1,newBread);
            // }
            // console.log(breadList)
            // this.breadList=breadList;
            // sessionStorage.setItem('breadListStorage',JSON.stringify(breadList));
        },

    }
}
</script>


